<?php 
  $objCurrency = new Zend_Currency();
?>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="content-view" id="teste">
  <tr>
    <td id="messenger" colspan="2"><?php echo $this->flashMessage();?></td>
  </tr>
  <tr>
    <td align="left" class="comp-title" style="width: 200px; text-transform: uppercase;">Preços e Parcelas</td>  
    <td>&nbsp;</td>
  </tr>
  
  <tr>
    <td align="center" colspan="2">
      <table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" class="content-form">
        <tr>
          <td class="space-bottom"></td>
        </tr>
        <tr>
          <td>
            <form name="form_add" method="post" action="" id="form_add">
              <table border="0" align="left" cellpadding="0" cellspacing="0" width="100%">
                <?php 
                  foreach($this->arrColunas as $strKey => $arrValues){
                    //Zend_Debug::dump($arrValues);
                    switch($arrValues['type']){
                      case 'text':
                        $strCampo = $this->input($arrValues['type'], $arrValues['name'], $arrValues['name'], isset($arrValues['default_value']) ? $arrValues['default_value'] : $this->request[$arrValues['name']], isset($arrValues['enabled']) ? $arrValues['enabled'] : true, '', $arrValues['maxlength'], '', "width: {$arrValues['width']}px;");
                      break;
                                            
                      case 'hidden':
                        $strCampo = $this->input($arrValues['type'], $arrValues['name'], $arrValues['name'], isset($arrValues['default_value']) ? $arrValues['default_value'] : $this->request[$arrValues['name']], isset($arrValues['enabled']) ? $arrValues['enabled'] : true, '', $arrValues['maxlength'], '', "width: {$arrValues['width']}px;");
                      break; 
                    }
                    
                    if($arrValues['type'] != 'hidden'){?>
                      <tr>    
                        <td align="right" class="label" style="width: 20%;">
                          <?php 
                            echo $arrValues['notnull'] ? '<span style="color: #FF0000; font-weight: bold"> * </span>' . $strKey : $strKey;
                          ?>:
                        </td>  
                        <td align="left" class="space-bottom" style="width: 60%;">
                          <?php echo $strCampo;?>
                        </td>
                        <td style="width: 20%;"><span>&nbsp;</span></td>                     
                      </tr>     
                      <?php
                    }
                    else{
                      ?>
                        <tr>
                          <td align="right" class="label"></td>  
                          <td align="left" class="space-bottom"><?php echo $strCampo?></td>   
                          <td><span>&nbsp;</span></td>                     
                        </tr>               
                      <?php
                    }
                  }
                ?>
                <tr>
                  <td></td>
                  <td>
                    <table border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
                      <thead> 
								        <tr> 
								          <th class="title-list" style="width: 7%"></th> 
								          <th class="title-list">Condição</th> 
								          <th class="title-list">Valor</th>  
								        </tr> 
								      </thead> 
								      <tbody>
								        <?php 
				                  foreach($this->arrParcelas as $strParcela => $strValor){
				                    //Zend_Debug::dump($arrParcelas);
				                    ?>
				                    <tr>
				                      <td class="result-list">
				                        <input type="radio" name="ds_parcela" id="ds_parcela" value="<?php echo $strParcela?>_<?php echo $strValor?>"/>
				                      </td>
				                      <td class="result-list" style="text-align: left;">
				                        <?php 
				                          if($strParcela == 1){
				                            echo 'À VISTA';
				                          }   
				                          else{
				                            echo $strParcela . 'X';
				                          }
				                        ?>
				                      </td>
				                      <td class="result-list">
				                        <?php echo $objCurrency->setValue($strValor);?>
			                        </td>
				                    </tr>
				                    <?php
				                  }
				                ?>
								      </tbody>
                    </table>
                  </td>
                  <td></td>
                </tr>
                <tr>
                  <td align="right" class="label"></td>
                  <td></td>
                  <td><span>&nbsp;</span></td>   
                </tr>
                <tr>  
                  <td align="left">
                    <?php 
                      echo $this->input('button', 'cancel', 'boton', '<< Voltar', true, '', '', '', '', "onclick=\"window.location='list'\"");
                    ?>
                  </td>
                  <td><span>&nbsp;</span></td>
                  <td align="right">
                    <?php 
                      echo $this->input('submit', 'save', 'boton', 'Avançar >>', true);
                    ?>
                  </td>
                </tr>
              </table>
            </form>
          </td>
        </tr>
      </table>
    </td>
  </tr>  
</table>